全部文档

2概览查询

获取本用户关键资源的概览信息。

2.1查询数据转发最近的聚合数据

功能描述:查询数据转发最近的聚合数据。

GET  /api/v1/routers/data/last

Query:

Name Type Description Required
interval int 时间间隔(1:小时; 2:天) Yes
count int 最近记录的数量 Yes

cURL example:

curl --location --request GET '{URI-scheme}://{Endpoint}{path-prefix}/api/v1/routers/data/last?accessKeyId={accessKeyId}&signatureNonce=166&signature={signature}&interval=1&count=2' \
--header 'platform: 3' \
--header 'projectId: {projectId}'

Response data:

Name Type Description
time long 数据产生时间
count int 转发总数量
countSuccess int 转发成功数量
countFailed int 转发失败数量
timeCostAverage float 数据平均转发时长(毫秒)

Response example:

{
    "data": [
        {
            "count": 0,
            "time": 1582848000,
            "countSuccess": 0,
            "countFailed": 0,
            "timeCostAverage": 0.0
        },
        {
            "count": 0,
            "time": 1583193600,
            "countSuccess": 0,
            "countFailed": 0,
            "timeCostAverage": 0.0
        }
    ],
    "success": true,
    "code": 0,
    "msg": null
}

2.2查询消息路由实例总数

功能描述:查询消息路由实例总数。

GET  /api/v1/routers/count

Query:

Name Type Description Required
platform int 平台类型 Yes

cURL example:

curl --location --request GET '{URI-scheme}://{Endpoint}{path-prefix}/api/v1/routers/count?accessKeyId={accessKeyId}&signatureNonce=166&signature={signature}&platform=2' \
--header 'platform: 3' \
--header 'projectId: {projectId}'

Response example:

{
    "data": 10,
    "success": true,
    "code": 0,
    "msg": null
}

2.3数据上传数量统计

功能描述:数据上传数量统计。

GET  /api/v1/data/overview/count/event

Query:

Name Type Description Required
uploadDuration int 时间区间(1表示24小时,7表示7天,30表示30天) Yes

cURL example:

curl --location --request GET '{URI-scheme}://{Endpoint}{path-prefix}/api/v1/data/overview/count/event?accessKeyId={accessKeyId}&signatureNonce=166&signature={signature}&uploadDuration=1' \
--header 'platform: 3' \
--header 'projectId: {projectId}'

Response data:

Name Type Description
userId string 用户ID
onlineNodeCount int 节点在线数
offlineNodeCount int 节点离线数
onlineDeviceCount int 设备在线数
offlineDeviceCount int 设备离线数
count long event数量
time date 时间

Response example:

{
    "data": [
        {
            "count": 0,
            "offlineDeviceCount": 0,
            "offlineNodeCount": 0,
            "onlineDeviceCount": 0,
            "onlineNodeCount": 0,
            "time": "2020-03-05T08:06:15.609Z",
            "userId": "string"

        },
        {
            "count": 0,
            "offlineDeviceCount": 0,
            "offlineNodeCount": 0,
            "onlineDeviceCount": 0,
            "onlineNodeCount": 0,
            "time": "2020-03-06T08:06:15.609Z",
            "userId": "string1"

        }
    ],
    "success": true,
    "code": 0,
    "msg": null
}

2.4按时间段统计边缘节点和边缘终端数量

功能描述:按时间段统计边缘节点和边缘终端数量。

GET  /api/v1/data/overview/count/duration

Query:

Name Type Description Required
nodeDeviceDuration int 时间区间(1表示24小时,7表示7天,30表示30天) Yes

cURL example:

curl --location --request GET '{URI-scheme}://{Endpoint}{path-prefix}/api/v1/data/overview/count/duration?accessKeyId={accessKeyId}&signatureNonce=166&signature={signature}&nodeDeviceDuration=1' \
--header 'platform: 3' \
--header 'projectId: {projectId}'

Response data:

Name Type Description
userId string 用户ID
onlineNodeCount int 节点在线数
offlineNodeCount int 节点离线数
onlineDeviceCount int 设备在线数
offlineDeviceCount int 设备离线数
count long event数量
time date 时间

Response example:

{
    "data": [
        {
            "count": 0,
            "offlineDeviceCount": 0,
            "offlineNodeCount": 0,
            "onlineDeviceCount": 0,
            "onlineNodeCount": 0,
            "time": "2020-03-05T08:06:15.609Z",
            "userId": "string"

        },
        {
            "count": 0,
            "offlineDeviceCount": 0,
            "offlineNodeCount": 0,
            "onlineDeviceCount": 0,
            "onlineNodeCount": 0,
            "time": "2020-03-06T08:06:15.609Z",
            "userId": "string1"

        }
    ],
    "success": true,
    "code": 0,
    "msg": null
}

2.5边缘节点和边缘终端实时数量统计

功能描述:边缘节点和边缘终端实时数量统计。

GET  /api/v1/data/overview/count/realtime

cURL example:

curl --location --request GET '{URI-scheme}://{Endpoint}{path-prefix}/api/v1/data/overview/count/realtime?accessKeyId={accessKeyId}&signatureNonce=166&signature={signature}' \
--header 'platform: 3' \
--header 'projectId: {projectId}'

Response data:

Name Type Description
nodeCount int 节点总数量
onlineNodeCount int 节点在线数
offlineNodeCount int 节点离线数
onlineDeviceCount int 设备在线数
offlineDeviceCount int 设备离线数
deviceCount int 设备总数量

Response example:

{
    "data": {
              "deviceCounter": {
                "deviceCount": 0,
                "offlineDeviceCount": 0,
                "onlineDeviceCount": 0
              },
              "nodeCounter": {
                "nodeCount": 0,
                "offlineNodeCount": 0,
                "onlineNodeCount": 0
              }
            },
    "success": true,
    "code": 0,
    "msg": null
}

2.6边缘节点监控

功能描述:边缘节点监控。

GET  /api/v1/data/overview/nodestatus

cURL example:

curl --location --request GET '{URI-scheme}://{Endpoint}{path-prefix}/api/v1/data/overview/nodestatus?accessKeyId={accessKeyId}&signatureNonce=166&signature={signature}' \
--header 'platform: 3' \
--header 'projectId: {projectId}'

Response data:

Name Type Description
cpu struct[] CPU
mem struct[] 内存
disk struct[] 磁盘

Response data cpu 的子对象结构体:

Name Type Description
pid int 产品id
did int 设备id
pName string 产品名称
dName string 设备名称
value struct[] CPU使用率

Response data mem 的子对象结构体:

Name Type Description
pid int 产品id
did int 设备id
pName string 产品名称
dName string 设备名称
value struct[] 内存使用率

Response data disk 的子对象结构体:

Name Type Description
pid int 产品id
did int 设备id
pName string 产品名称
dName string 设备名称
value struct[] 磁盘使用率

Response example:

{
    "data": {
              "cpu": [{
                "pid": 100851,
                "did": 10012126,
                "pName": svm,
                "dName": svm01,
                "value": 0.023
              }],
              "mem": [{
                "pid": 100852,
                "did": 10012127,
                "pName": svm,
                "dName": svm01,
                "value": 0.123
              }],
              "disk": [{
                "pid": 100853,
                "did": 10012128,
                "pName": svm,
                "dName": svm01,
                "value": 0.223
              }]
            },
    "success": true,
    "code": 0,
    "msg": null
}

results matching ""

    No results matching ""